home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Original Code / Beziers and Other Splines / BezierClock / BezierClock.cs next >
Encoding:
Text File  |  2001-01-15  |  1008 b   |  38 lines

  1. //------------------------------------------
  2. // BezierClock.cs ⌐ 2001 by Charles Petzold
  3. //------------------------------------------
  4. using Petzold.ProgrammingWindowsWithCSharp;
  5. using System;
  6. using System.Drawing;
  7. using System.Windows.Forms;
  8.  
  9. class BezierClock: Form
  10. {
  11.      BezierClockControl clkctl;
  12.  
  13.      public static void Main()
  14.      {
  15.           Application.Run(new BezierClock());
  16.      }
  17.      public BezierClock()
  18.      {
  19.           Text = "Bezier Clock";
  20.  
  21.           clkctl = new BezierClockControl();
  22.           clkctl.Parent    = this;
  23.           clkctl.Time      = DateTime.Now;
  24.           clkctl.Dock      = DockStyle.Fill;
  25.           clkctl.BackColor = Color.Black;
  26.           clkctl.ForeColor = Color.White;
  27.  
  28.           Timer timer = new Timer();
  29.           timer.Interval = 100;
  30.           timer.Tick += new EventHandler(OnTimerTick);
  31.           timer.Start();
  32.      }
  33.      void OnTimerTick(object obj, EventArgs ea)
  34.      {
  35.           clkctl.Time = DateTime.Now;
  36.      }
  37. }
  38.